![]() |
PBHGetVInfoAsync |
||||
Header: | Files.h | Carbon status: | Supported | |
Gets detailed information about a volume.
OSErr PBHGetVInfoAsync ( HParmBlkPtr paramBlock );
A pointer to a basic HFS parameter block.
A result code.
The relevant fields of the parameter block are:
On input, a pointer to a completion function.
On output, the result code of the function.
On input, a pointer to a buffer. On output, a pointer to the volume’s name. You should pass a pointer to a Str31 value if you want the name returned. If you pass NULL, no volume name is returned.
On input, a volume specification. On output, the volume reference number..
On input, an index used for indexing through all mounted volumes.
On output, the date and time of initialization.
On output, the date and time of last modification.
On output, the volume attributes.
On output, the number of files in the root directory.
If you pass a working directory reference number in ioVRefNum (or if the default directory is a subdirectory), the number of files and directories in the specified directory (the directory’s valence) is returned here.
On output, the first block of the volume bitmap.
On output, the block at which the next new file starts.
On output, the number of allocation blocks.
On output, the size of allocation blocks.
On output, the default clump size.
On output, the first block in the volume block map
On output, the next unused catalog node ID.
On output, the number of unused allocation blocks.
On output, the volume signature.
On output, the drive number. For online volumes, ioVDrvInfo contains the drive number of the drive containing the specified volume and hence is always greater than 0. If the value returned in ioVDrvInfo is 0, the volume is either offline or ejected.
On output, the driver reference number. You can determine whether the volume is offline or ejected by inspecting the value of this field. For online volumes, ioVDRefNum contains a driver reference number; these numbers are always less than 0. If the volume is not online, the value of ioVDRefNum is either the negative of the drive number (if the volume is offline) or the drive number itself (if the volume is ejected).
On output, the file system handling this volume.
On output, the date and time of the last backup.
Used internally.
On output, the volume write count.
On output, the number of files on the volume.
On output, the number of directories on the volume
Information used by the Finder
The PBHGetVInfoAsync function returns information about the specified volume. If the value of ioVolIndex is positive, the File Manager attempts to use it to find the volume; for instance, if the value of ioVolIndex is 2, the File Manager attempts to access the second mounted volume in the VCB queue. If the value of ioVolIndex is negative, the File Manager uses ioNamePtr and ioVRefNum in the standard way to determine the volume. If the value of ioVolIndex is 0, the File Manager attempts to access the volume by using ioVRefNum only.
You can read the ioVDrvInfo and ioVDRefNum fields to determine whether the specified volume is online, offline, or ejected. You can get information about all the online volumes by making repeated calls to PBHGetVInfoAsync, starting with the value of ioVolIndex set to 1 and incrementing that value until PBHGetVInfoAsync returns nsvErr.
The values returned in the ioVNmAlBlks and ioVFrBlk fields are unsigned integers. You need to exercise special care when reading those values from Pascal.
Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.
© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)